package cn.cque.controller;

import cn.cque.entity.Category;
import cn.cque.service.CategoryService;
import cn.cque.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: XWC
 * @ClassName: CategoryController
 * @Date: 2020/10/4
 * @Time: 18:38
 * @Description:
 */
@Controller
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;

    @RequestMapping("/list")
    @ResponseBody
    public List<Category> categoryList(){
        return categoryService.findAll();
    }
}